Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cancel the network stream if AsyncStream is cancelled, #3

Conversation

ConfusedVorlon
Copy link
Contributor

I love that your package supports stopping streams. That seems to be a major gap in other packages. Thank you.

I'm using the AsyncThrowing stream in a Task, and noticed that if I cancel the Task, then the cancellation automatically propagates to the stream.

This was actually a problem as it meant I didn't get a chance to check for Task.isCancelled - and stop the networkStream manually.

Then I realised that this can be done automatically using onTermination of the continuation.

Thoughts?

@kyrylo-mukha
Copy link
Contributor

kyrylo-mukha commented Apr 17, 2023

Hi! Thank you for approach and feedback.
It's great solution. We will approve and add it in sooner update.

UPD: We added your solution to 1.4.0 version. Thank you for contributing and help us and our library being better.

@kyrylo-mukha kyrylo-mukha merged commit 3a7f1c7 into FuturraGroup:main Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants